package utils

import "encoding/json"

func StructMap(source interface{}, target interface{}) {
	sourceByte, _ := json.Marshal(source)
	_ = json.Unmarshal(sourceByte, target)
}

func StructMapStrict(source interface{}, target interface{}) error {
	sourceByte, err := json.Marshal(source)
	if err != nil {
		return err
	}
	return json.Unmarshal(sourceByte, target)
}
